import { service } from '@/utils/request'
import store from '../store/index';
// 获取图片列表
export function getImgList(page, file_group) {
  return service({
    url: '/Upload/lists',
    method: 'post',
    data: {
      token: store.state.user.token,
      page,
      file_group
    }
  })
}
// 获取图片类别
export function getImgSort() {
  return service({
    url: '/Upload/file_group',
    method: 'post',
    data: {
      token: store.state.user.token
    }
  })
}

// 删除图片
export function delImgs(id) {
  return service({
    url: '/Upload/delete',
    method: 'post',
    data: {
      token: store.state.user.token,
      id
    }
  })
}

// base64上传图片
export function base64_Upfile(obj) {
  const { image, type, file_group } = obj;
  return service({
    url: '/Upload/upload',
    method: 'post',
    data: {
      token: store.state.user.token,
      image,
      type,
      file_group
    }
  })
}
